package com.chengqj.factory.singlefactory;

/**
 * @program: pattern
 * @description: 懒汉式方式一：直接方法锁
 * @author: chengqj
 * @create: 2018-08-06 18:13
 **/
public class LazyOne {
    private LazyOne(){}

    private static LazyOne lazy = null;

    public static synchronized LazyOne getInstance(){
        if(lazy == null){
            lazy = new LazyOne();
        }
        return lazy;

    }
}
